-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add the capability to reload the current search #1515
Conversation
1604e0b
to
25466c7
Compare
const resettable = resettableState(); | ||
resettable.query = state.query; | ||
resettable.facets = state.facets as never[]; | ||
resettable.sort = state.sort; | ||
resettable.page = state.page; | ||
Object.assign(state, resettable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering a simpler implementation of this function and the only way I think it could be done would be like this, if you like it I leave it here to use it 😉
const resettable = resettableState(); | |
resettable.query = state.query; | |
resettable.facets = state.facets as never[]; | |
resettable.sort = state.sort; | |
resettable.page = state.page; | |
Object.assign(state, resettable); | |
const { query, facets, sort, page, ...resettable } = resettableState(); | |
Object.assign(state, resettable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
6e11862
to
493563b
Compare
/** | ||
* Reload the current search has been requested. | ||
*/ | ||
ReloadSearchRequested: undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReloadSearchRequested: undefined; | |
ReloadSearchRequested: void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
493563b
to
ab634d0
Compare
Pull request template
We need a way to refresh the results displayed on the search layer.
Motivation and context
This requirement comes from the Backroom's next functionality, boost&bury of single products by query. After boosting or burying a product, we need a way to re-do the current search and refresh the results to see the change applied.
The idea is to emit the event
ReloadSearchRequested
through the x-bus and trigger a mutation on the state that triggers the search request.Type of change
What is the destination branch of this PR?
Main
How has this been tested?
Tests performed according to testing guidelines:
Checklist: